
package com.scs.application.modules.upms.controller;


import com.baomidou.mybatisplus.core.metadata.IPage;
import com.scs.application.core.model.CommonResult;
import com.scs.application.core.model.PageResult;
import com.scs.application.core.mvc.controller.CrudController;
import com.scs.application.core.mvc.controller.ImAndExAbleController;
import com.scs.application.modules.upms.entity.DictType;
import com.scs.application.modules.upms.request.DictTypeQueryRequest;
import com.scs.application.modules.upms.service.DictTypeService;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
* 字典类型 controller
*
*/
@AllArgsConstructor
@RestController
@RequestMapping("/upms/dict_types")
public class DictTypeController extends CrudController<DictType, String, DictTypeService> implements ImAndExAbleController<DictTypeQueryRequest> {



    @GetMapping("/page")
    public PageResult page(DictTypeQueryRequest request) {
        IPage page = service.page(request);
        return PageResult.ok("查询成功", page.getRecords(), page.getTotal());
    }

    @GetMapping("/list")
    public CommonResult list(DictTypeQueryRequest request) {
        List<DictType> list = service.list(request);
        return CommonResult.ok("查询成功", list);
    }



}
